<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>


<script>


  /*
  function sum(a, b) {
    return a + b
  }

  const sum = function (a, b) {
    return a + b
  }

  const sum = (a, b) => {
    return a + b
  }
  */
  // const sum = (a, b) => a + b
  // console.log(sum(10, 6))

  /*
  const p1 = (name, age) => {
    return {
      name: name,
      age: age
    }
  }
  const p1 = (name, age) => ({name: name, age: age})
  */
  // console.log(p1('张三', 18))
  // console.log(p1('王五', 18))

  /*
  const fullName = ({firstName, lastName}) => {
    return firstName + '-' + lastName
    // return option.firstName + '—' + option.lastName
  }*/

  /*
  const fullName = ({firstName, lastName}) => firstName + '-' + lastName
  console.log(fullName({
    firstName: '斯蒂芬',
    lastName: '库里',
  }))*/





  // function sayHi(x, y = 'ES6') {
  /*
  function sayHi(x, ...props) {
    // console.log(x + ' ' + y)
    console.log(x)
    console.log(props)
  }
  sayHi('hello', 'es6', '!!!')*/


</script>
</body>
</html>